package com.piesat.quake.business.device.model;

import com.piesat.quake.business.device.model.config.NtpData;
import com.piesat.quake.business.device.model.config.Passageway;
import com.piesat.quake.business.device.model.config.StationAndThreshold;
import com.piesat.quake.business.device.model.config.network.FtpConfig;
import com.piesat.quake.business.device.model.config.network.MqttConfig;
import com.piesat.quake.business.device.model.config.network.UpdateConfig;
import com.piesat.quake.business.device.mqtt.anno.NodeField;
import com.piesat.quake.business.device.mqtt.anno.PipelineNode;

import lombok.Data;
import lombok.EqualsAndHashCode;



/**
 * 获取到的设备配置
 *
 * @author Gersy
 * @date 2023/3/10
 * @since 1.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
@PipelineNode(preNodes = {BaseModel.class})
public class DeviceOptions extends BaseModel {
    @NodeField
    private MqttConfig mqttConfig;
    @NodeField
    private FtpConfig ftpConfig;
    @NodeField
    private FtpConfig ftpLogConfig;
    @NodeField
    private UpdateConfig updateConfig;
    @NodeField(excludeFields = {"length"})
    private NtpData ntp;
    @NodeField
    private StationAndThreshold stationAndThreshold;

    @NodeField(clazz = Passageway.class)
    Passageway passageway1;
    @NodeField(clazz = Passageway.class)
    Passageway passageway2;
    @NodeField(clazz = Passageway.class)
    Passageway passageway3;
    @NodeField(clazz = Passageway.class)
    Passageway passageway4;
    @NodeField(clazz = Passageway.class)
    Passageway passageway5;
    @NodeField(clazz = Passageway.class)
    Passageway passageway6;

    @Override
    public String toString() {
        return "DeviceOptions{" +
                "id='" + id + '\'' +
                ",\r\n type='" + type + '\'' +
                ",\r\n length=" + length +
                ",\r\n id='" + id + '\'' +
                ",\r\n endian=" + endian +
                ",\r\n timestamp=" + timestamp +
                ",\r\n mqttConfig=" + mqttConfig +
                ",\r\n ftpConfig=" + ftpConfig +
                ",\r\n ftpLogConfig=" + ftpLogConfig +
                ",\r\n updateConfig=" + updateConfig +
                ",\r\n ntp=" + ntp +
                ",\r\n stationAndThreshold=" + stationAndThreshold +
                ",\r\n passageway1=" + passageway1 +
                ",\r\n passageway2=" + passageway2 +
                ",\r\n passageway3=" + passageway3 +
                ",\r\n passageway4=" + passageway4 +
                ",\r\n passageway4=" + passageway5 +
                ",\r\n passageway4=" + passageway6 +
                '}';
    }
}
